<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let obj = [
        { uname: '张三', score: 90, status: '1' },
        { uname: '李四', score: 10, status: '3' },
        { uname: '王五', score: 70, status: '2' },
      ]
      let newobj = {
        1: '优秀',
        2: '良好',
        3: '差劲',
      }
      // console.log(newobj['1'])
      // 如果1 显示优秀，如果是2 显示良好，3 显示差劲
      //效果如下 打印页面
      // 张三 优秀
      // 李四 差劲
      // 王五 良好
      let objd = obj
      // console.log(objd)
      objd.forEach((e) => {
        for (let k in newobj) {
          e.status == k ? (e.status = newobj[k]) : e.status
        }
      })
      console.log(objd)
    </script>
  </body>
</html>
